Visit our Youtube channel to access new animated learning tricks Click Here.
0 votes
4.1k views
by (7.8k points)
What is an easy way to remember the difference between checked and unchecked exceptions?

1 Answer

0 votes
by (7.8k points)

In java Exception is an abnormal condition in code.
Checked exception in Java is something that is done during compile time.
Unchecked exception is an exception that extends RuntimeException and it occurs only while the program is running.

It's a bit confusing to remember both, but there is a simple trick to do this. 

The trick is to observe for the pattern 'UN'.

'UN'CHECKED exception extends R'UN'timeException

If you keep this pattern in mind you'll never get confused with checked and unchecked exceptions again.

Related questions

Sharing improves retention
...